// const mobile = ()=>{
//     console.log('--------------------------')
//     let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
//       // localStorage.setItem('isiphone',flag)
//       console.log(flag)
//       return flag;
//     }

export const warp_fun = (componentName) =>{
    const routerjs = ()=>{
        console.log('进行 pc端 和 移动端 切换');
        console.log(componentName);
        let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
        //     console.log(flag);
        // flag = true
        if(flag){
            console.log('手机端')
            return import(`../views/mobile/${componentName}/index.vue`)
        }else{
            console.log('pc端')
            return import(`../views/${componentName}/index.vue`)
        }
    }
    return routerjs;
}
